﻿Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient

Public Class frmHangHoa
    Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnNew As System.Windows.Forms.Button
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents btnDelete1 As System.Windows.Forms.Button
    Friend WithEvents BtnClose As System.Windows.Forms.Button
    Friend WithEvents TxtHanDung As System.Windows.Forms.TextBox
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents TxtMax As System.Windows.Forms.TextBox
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents TxtMin As System.Windows.Forms.TextBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents TxtGiaBan As System.Windows.Forms.TextBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents TxtTenNhomHH As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents txtTen_HD As System.Windows.Forms.TextBox
    Friend WithEvents txtTen_BD As System.Windows.Forms.TextBox
    Friend WithEvents txtMa_HH As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
    Friend WithEvents DataSetForm_Don As PHUQUI.DataSetForm_Don
    Friend WithEvents TxtQC_Thung As System.Windows.Forms.TextBox
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents TxtDV_Thung As System.Windows.Forms.TextBox
    Friend WithEvents TxtDV_Chan As System.Windows.Forms.TextBox
    Friend WithEvents TxtQC_Chan As System.Windows.Forms.TextBox
    Friend WithEvents TxtDV_Le As System.Windows.Forms.TextBox
    Friend WithEvents TxtQC_Le As System.Windows.Forms.TextBox
    Friend WithEvents CboNhomHH As MTGCComboBox
    Friend WithEvents CboNhomDC As MTGCComboBox
    Friend WithEvents TxtTenNhomDC As System.Windows.Forms.TextBox
    Friend WithEvents Label13 As System.Windows.Forms.Label
    Friend WithEvents TxtChietKhau As System.Windows.Forms.TextBox
    Friend WithEvents Label14 As System.Windows.Forms.Label
    Friend WithEvents DataSetFormDonBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents TabMain As System.Windows.Forms.TabControl
    Friend WithEvents TabThongTin As System.Windows.Forms.TabPage
    Friend WithEvents TabTimKiem As System.Windows.Forms.TabPage
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents txtMaSearch As System.Windows.Forms.TextBox
    Friend WithEvents btnTimKiem As System.Windows.Forms.Button
    Friend WithEvents txtTenSearch As System.Windows.Forms.TextBox
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents DataSetSearch As PHUQUI.DataSetSearch
    Friend WithEvents gridSearch As System.Windows.Forms.DataGridView
    Friend WithEvents DataSetSearchBindingSource As System.Windows.Forms.BindingSource
    Friend WithEvents Label17 As System.Windows.Forms.Label
    Friend WithEvents txtDieuKien As System.Windows.Forms.TextBox
    Friend WithEvents Label15 As System.Windows.Forms.Label
    Friend WithEvents txtSDK As System.Windows.Forms.TextBox
    Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip
    Friend WithEvents InDSKháchHàngToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
    Friend WithEvents InDSKháchHàngGDPToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents LblRecords As System.Windows.Forms.Label
    Friend WithEvents LblRecordSearch As System.Windows.Forms.Label
    Friend WithEvents TxtGiaSYT As System.Windows.Forms.TextBox
    Friend WithEvents colma_hanghoa As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colten_bietduoc As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colten_hoaduoc As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldonvi_banchan As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldonvi_thung As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colquicach_thung As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colquicach_banchan As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldonvi_banle As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colquicach_banle As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldongia_bo As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldongia_ban As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colchietkhau As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colma_nhomhanghoa As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colma_duocchinh As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colhandung As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colmin_ As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colmax_ As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents colsdk As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents coldkbaoquan As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ma_hanghoaS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ten_bietduocS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ten_hoaduocS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents donvi_banchanS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents donvi_thungS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents quicach_thungS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents quicach_banchanS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents donvi_banleS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents quicach_banleS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents dongia_boS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents dongia_banS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents chietkhauS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ma_nhomhanghoaS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ma_duocchinhS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents handungS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents min_S As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents max_S As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents sdkS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents dkbaoquanS As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents Button1 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmHangHoa))
        Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle9 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle10 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle
        Me.btnSave = New System.Windows.Forms.Button
        Me.btnNew = New System.Windows.Forms.Button
        Me.btnDelete1 = New System.Windows.Forms.Button
        Me.BtnClose = New System.Windows.Forms.Button
        Me.Button1 = New System.Windows.Forms.Button
        Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
        Me.InDSKháchHàngToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
        Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator
        Me.InDSKháchHàngGDPToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
        Me.TxtHanDung = New System.Windows.Forms.TextBox
        Me.Label10 = New System.Windows.Forms.Label
        Me.TxtMax = New System.Windows.Forms.TextBox
        Me.Label9 = New System.Windows.Forms.Label
        Me.TxtMin = New System.Windows.Forms.TextBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.Label7 = New System.Windows.Forms.Label
        Me.TxtGiaBan = New System.Windows.Forms.TextBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.TxtTenNhomHH = New System.Windows.Forms.TextBox
        Me.Label5 = New System.Windows.Forms.Label
        Me.txtTen_HD = New System.Windows.Forms.TextBox
        Me.txtTen_BD = New System.Windows.Forms.TextBox
        Me.txtMa_HH = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.DataGridView1 = New System.Windows.Forms.DataGridView
        Me.colma_hanghoa = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colten_bietduoc = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colten_hoaduoc = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldonvi_banchan = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldonvi_thung = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colquicach_thung = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colquicach_banchan = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldonvi_banle = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colquicach_banle = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldongia_bo = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldongia_ban = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colchietkhau = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colma_nhomhanghoa = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colma_duocchinh = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colhandung = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colmin_ = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colmax_ = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.colsdk = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.coldkbaoquan = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataSetFormDonBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DataSetForm_Don = New PHUQUI.DataSetForm_Don
        Me.TxtQC_Thung = New System.Windows.Forms.TextBox
        Me.Label12 = New System.Windows.Forms.Label
        Me.TxtDV_Thung = New System.Windows.Forms.TextBox
        Me.TxtDV_Chan = New System.Windows.Forms.TextBox
        Me.TxtQC_Chan = New System.Windows.Forms.TextBox
        Me.TxtDV_Le = New System.Windows.Forms.TextBox
        Me.TxtQC_Le = New System.Windows.Forms.TextBox
        Me.CboNhomHH = New MTGCComboBox
        Me.CboNhomDC = New MTGCComboBox
        Me.TxtTenNhomDC = New System.Windows.Forms.TextBox
        Me.Label13 = New System.Windows.Forms.Label
        Me.TxtChietKhau = New System.Windows.Forms.TextBox
        Me.Label14 = New System.Windows.Forms.Label
        Me.TabMain = New System.Windows.Forms.TabControl
        Me.TabThongTin = New System.Windows.Forms.TabPage
        Me.LblRecords = New System.Windows.Forms.Label
        Me.Label17 = New System.Windows.Forms.Label
        Me.txtDieuKien = New System.Windows.Forms.TextBox
        Me.Label15 = New System.Windows.Forms.Label
        Me.txtSDK = New System.Windows.Forms.TextBox
        Me.TxtGiaSYT = New System.Windows.Forms.TextBox
        Me.TabTimKiem = New System.Windows.Forms.TabPage
        Me.LblRecordSearch = New System.Windows.Forms.Label
        Me.Label16 = New System.Windows.Forms.Label
        Me.txtMaSearch = New System.Windows.Forms.TextBox
        Me.btnTimKiem = New System.Windows.Forms.Button
        Me.txtTenSearch = New System.Windows.Forms.TextBox
        Me.Label11 = New System.Windows.Forms.Label
        Me.gridSearch = New System.Windows.Forms.DataGridView
        Me.ma_hanghoaS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ten_bietduocS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ten_hoaduocS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.donvi_banchanS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.donvi_thungS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.quicach_thungS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.quicach_banchanS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.donvi_banleS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.quicach_banleS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.dongia_boS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.dongia_banS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.chietkhauS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ma_nhomhanghoaS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.ma_duocchinhS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.handungS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.min_S = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.max_S = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.sdkS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.dkbaoquanS = New System.Windows.Forms.DataGridViewTextBoxColumn
        Me.DataSetSearchBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Me.DataSetSearch = New PHUQUI.DataSetSearch
        Me.ContextMenuStrip1.SuspendLayout()
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetFormDonBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.TabMain.SuspendLayout()
        Me.TabThongTin.SuspendLayout()
        Me.TabTimKiem.SuspendLayout()
        CType(Me.gridSearch, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetSearchBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.DataSetSearch, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'btnSave
        '
        Me.btnSave.BackColor = System.Drawing.Color.Transparent
        Me.btnSave.Image = CType(resources.GetObject("btnSave.Image"), System.Drawing.Image)
        Me.btnSave.Location = New System.Drawing.Point(235, 160)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.Size = New System.Drawing.Size(96, 24)
        Me.btnSave.TabIndex = 19
        Me.btnSave.UseVisualStyleBackColor = False
        '
        'btnNew
        '
        Me.btnNew.Image = CType(resources.GetObject("btnNew.Image"), System.Drawing.Image)
        Me.btnNew.Location = New System.Drawing.Point(128, 160)
        Me.btnNew.Name = "btnNew"
        Me.btnNew.Size = New System.Drawing.Size(96, 24)
        Me.btnNew.TabIndex = 20
        '
        'btnDelete1
        '
        Me.btnDelete1.Image = CType(resources.GetObject("btnDelete1.Image"), System.Drawing.Image)
        Me.btnDelete1.Location = New System.Drawing.Point(343, 160)
        Me.btnDelete1.Name = "btnDelete1"
        Me.btnDelete1.Size = New System.Drawing.Size(88, 24)
        Me.btnDelete1.TabIndex = 29
        '
        'BtnClose
        '
        Me.BtnClose.Image = CType(resources.GetObject("BtnClose.Image"), System.Drawing.Image)
        Me.BtnClose.Location = New System.Drawing.Point(550, 160)
        Me.BtnClose.Name = "BtnClose"
        Me.BtnClose.Size = New System.Drawing.Size(88, 24)
        Me.BtnClose.TabIndex = 30
        '
        'Button1
        '
        Me.Button1.ContextMenuStrip = Me.ContextMenuStrip1
        Me.Button1.Image = CType(resources.GetObject("Button1.Image"), System.Drawing.Image)
        Me.Button1.Location = New System.Drawing.Point(446, 160)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(88, 24)
        Me.Button1.TabIndex = 28
        '
        'ContextMenuStrip1
        '
        Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.InDSKháchHàngToolStripMenuItem, Me.ToolStripSeparator1, Me.InDSKháchHàngGDPToolStripMenuItem})
        Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
        Me.ContextMenuStrip1.Size = New System.Drawing.Size(185, 54)
        '
        'InDSKháchHàngToolStripMenuItem
        '
        Me.InDSKháchHàngToolStripMenuItem.Name = "InDSKháchHàngToolStripMenuItem"
        Me.InDSKháchHàngToolStripMenuItem.Size = New System.Drawing.Size(184, 22)
        Me.InDSKháchHàngToolStripMenuItem.Text = "In DS Hàng Hóa"
        '
        'ToolStripSeparator1
        '
        Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
        Me.ToolStripSeparator1.Size = New System.Drawing.Size(181, 6)
        '
        'InDSKháchHàngGDPToolStripMenuItem
        '
        Me.InDSKháchHàngGDPToolStripMenuItem.Name = "InDSKháchHàngGDPToolStripMenuItem"
        Me.InDSKháchHàngGDPToolStripMenuItem.Size = New System.Drawing.Size(184, 22)
        Me.InDSKháchHàngGDPToolStripMenuItem.Text = "In DS Hàng Hóa GDP"
        '
        'TxtHanDung
        '
        Me.TxtHanDung.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtHanDung.Location = New System.Drawing.Point(642, 108)
        Me.TxtHanDung.MaxLength = 10
        Me.TxtHanDung.Name = "TxtHanDung"
        Me.TxtHanDung.Size = New System.Drawing.Size(155, 22)
        Me.TxtHanDung.TabIndex = 16
        Me.TxtHanDung.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label10
        '
        Me.Label10.Location = New System.Drawing.Point(527, 108)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(104, 18)
        Me.Label10.TabIndex = 74
        Me.Label10.Text = "Hạn dùng ( tháng )"
        '
        'TxtMax
        '
        Me.TxtMax.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtMax.Location = New System.Drawing.Point(361, 108)
        Me.TxtMax.MaxLength = 10
        Me.TxtMax.Name = "TxtMax"
        Me.TxtMax.Size = New System.Drawing.Size(155, 22)
        Me.TxtMax.TabIndex = 15
        Me.TxtMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(274, 108)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(76, 18)
        Me.Label9.TabIndex = 73
        Me.Label9.Text = "Số lượng Max"
        '
        'TxtMin
        '
        Me.TxtMin.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtMin.Location = New System.Drawing.Point(104, 108)
        Me.TxtMin.MaxLength = 10
        Me.TxtMin.Name = "TxtMin"
        Me.TxtMin.Size = New System.Drawing.Size(155, 22)
        Me.TxtMin.TabIndex = 14
        Me.TxtMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(19, 108)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(79, 18)
        Me.Label8.TabIndex = 72
        Me.Label8.Text = "Số lượng Min"
        Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(271, 84)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(81, 19)
        Me.Label7.TabIndex = 71
        Me.Label7.Text = "Đơn giá vốn"
        '
        'TxtGiaBan
        '
        Me.TxtGiaBan.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtGiaBan.Location = New System.Drawing.Point(104, 83)
        Me.TxtGiaBan.MaxLength = 10
        Me.TxtGiaBan.Name = "TxtGiaBan"
        Me.TxtGiaBan.Size = New System.Drawing.Size(155, 22)
        Me.TxtGiaBan.TabIndex = 11
        Me.TxtGiaBan.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(27, 84)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(71, 19)
        Me.Label6.TabIndex = 70
        Me.Label6.Text = "Đơn giá bán"
        Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'TxtTenNhomHH
        '
        Me.TxtTenNhomHH.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtTenNhomHH.Location = New System.Drawing.Point(181, 59)
        Me.TxtTenNhomHH.MaxLength = 10
        Me.TxtTenNhomHH.Name = "TxtTenNhomHH"
        Me.TxtTenNhomHH.Size = New System.Drawing.Size(288, 22)
        Me.TxtTenNhomHH.TabIndex = 57
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 61)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(90, 17)
        Me.Label5.TabIndex = 69
        Me.Label5.Text = "Nhóm hàng hóa"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'txtTen_HD
        '
        Me.txtTen_HD.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtTen_HD.Location = New System.Drawing.Point(104, 35)
        Me.txtTen_HD.MaxLength = 100
        Me.txtTen_HD.Name = "txtTen_HD"
        Me.txtTen_HD.Size = New System.Drawing.Size(527, 22)
        Me.txtTen_HD.TabIndex = 2
        '
        'txtTen_BD
        '
        Me.txtTen_BD.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtTen_BD.Location = New System.Drawing.Point(292, 11)
        Me.txtTen_BD.MaxLength = 50
        Me.txtTen_BD.Name = "txtTen_BD"
        Me.txtTen_BD.Size = New System.Drawing.Size(506, 22)
        Me.txtTen_BD.TabIndex = 1
        '
        'txtMa_HH
        '
        Me.txtMa_HH.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtMa_HH.Location = New System.Drawing.Point(104, 11)
        Me.txtMa_HH.MaxLength = 10
        Me.txtMa_HH.Name = "txtMa_HH"
        Me.txtMa_HH.Size = New System.Drawing.Size(103, 22)
        Me.txtMa_HH.TabIndex = 0
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(16, 37)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(82, 19)
        Me.Label4.TabIndex = 67
        Me.Label4.Text = "Tên hóa dược"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(213, 11)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(78, 19)
        Me.Label3.TabIndex = 66
        Me.Label3.Text = "Tên biệt dược "
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(25, 10)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(73, 19)
        Me.Label2.TabIndex = 65
        Me.Label2.Text = "Mã hàng hóa"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(256, -1)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(304, 24)
        Me.Label1.TabIndex = 64
        Me.Label1.Text = "DANH MỤC HÀNG HÓA"
        '
        'DataGridView1
        '
        Me.DataGridView1.AllowUserToAddRows = False
        Me.DataGridView1.AllowUserToDeleteRows = False
        Me.DataGridView1.AllowUserToResizeColumns = False
        Me.DataGridView1.AutoGenerateColumns = False
        Me.DataGridView1.BackgroundColor = System.Drawing.Color.LightBlue
        DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.DataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
        Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.DataGridView1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colma_hanghoa, Me.colten_bietduoc, Me.colten_hoaduoc, Me.coldonvi_banchan, Me.coldonvi_thung, Me.colquicach_thung, Me.colquicach_banchan, Me.coldonvi_banle, Me.colquicach_banle, Me.coldongia_bo, Me.coldongia_ban, Me.colchietkhau, Me.colma_nhomhanghoa, Me.colma_duocchinh, Me.colhandung, Me.colmin_, Me.colmax_, Me.colsdk, Me.coldkbaoquan})
        Me.DataGridView1.DataMember = "tbl_hanghoa"
        Me.DataGridView1.DataSource = Me.DataSetFormDonBindingSource
        Me.DataGridView1.Location = New System.Drawing.Point(4, 203)
        Me.DataGridView1.Name = "DataGridView1"
        Me.DataGridView1.ReadOnly = True
        Me.DataGridView1.RowHeadersWidth = 25
        Me.DataGridView1.Size = New System.Drawing.Size(892, 342)
        Me.DataGridView1.TabIndex = 76
        '
        'colma_hanghoa
        '
        Me.colma_hanghoa.DataPropertyName = "ma_hanghoa"
        Me.colma_hanghoa.HeaderText = "Mã HH"
        Me.colma_hanghoa.Name = "colma_hanghoa"
        Me.colma_hanghoa.ReadOnly = True
        Me.colma_hanghoa.Width = 90
        '
        'colten_bietduoc
        '
        Me.colten_bietduoc.DataPropertyName = "ten_bietduoc"
        Me.colten_bietduoc.HeaderText = "Tên HH"
        Me.colten_bietduoc.Name = "colten_bietduoc"
        Me.colten_bietduoc.ReadOnly = True
        Me.colten_bietduoc.Width = 270
        '
        'colten_hoaduoc
        '
        Me.colten_hoaduoc.DataPropertyName = "ten_hoaduoc"
        Me.colten_hoaduoc.HeaderText = "Tên hoá dược"
        Me.colten_hoaduoc.Name = "colten_hoaduoc"
        Me.colten_hoaduoc.ReadOnly = True
        Me.colten_hoaduoc.Visible = False
        '
        'coldonvi_banchan
        '
        Me.coldonvi_banchan.DataPropertyName = "donvi_banchan"
        DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        Me.coldonvi_banchan.DefaultCellStyle = DataGridViewCellStyle2
        Me.coldonvi_banchan.HeaderText = "ĐVT"
        Me.coldonvi_banchan.Name = "coldonvi_banchan"
        Me.coldonvi_banchan.ReadOnly = True
        Me.coldonvi_banchan.Width = 60
        '
        'coldonvi_thung
        '
        Me.coldonvi_thung.DataPropertyName = "donvi_thung"
        Me.coldonvi_thung.HeaderText = "donvi_thung"
        Me.coldonvi_thung.Name = "coldonvi_thung"
        Me.coldonvi_thung.ReadOnly = True
        Me.coldonvi_thung.Visible = False
        '
        'colquicach_thung
        '
        Me.colquicach_thung.DataPropertyName = "quicach_thung"
        Me.colquicach_thung.HeaderText = "quicach_thung"
        Me.colquicach_thung.Name = "colquicach_thung"
        Me.colquicach_thung.ReadOnly = True
        Me.colquicach_thung.Visible = False
        '
        'colquicach_banchan
        '
        Me.colquicach_banchan.DataPropertyName = "quicach_banchan"
        Me.colquicach_banchan.HeaderText = "quicach_banchan"
        Me.colquicach_banchan.Name = "colquicach_banchan"
        Me.colquicach_banchan.ReadOnly = True
        Me.colquicach_banchan.Visible = False
        '
        'coldonvi_banle
        '
        Me.coldonvi_banle.DataPropertyName = "donvi_banle"
        Me.coldonvi_banle.HeaderText = "donvi_banle"
        Me.coldonvi_banle.Name = "coldonvi_banle"
        Me.coldonvi_banle.ReadOnly = True
        Me.coldonvi_banle.Visible = False
        '
        'colquicach_banle
        '
        Me.colquicach_banle.DataPropertyName = "quicach_banle"
        Me.colquicach_banle.HeaderText = "quicach_banle"
        Me.colquicach_banle.Name = "colquicach_banle"
        Me.colquicach_banle.ReadOnly = True
        Me.colquicach_banle.Visible = False
        '
        'coldongia_bo
        '
        Me.coldongia_bo.DataPropertyName = "dongia_bo"
        Me.coldongia_bo.HeaderText = "dongia_bo"
        Me.coldongia_bo.Name = "coldongia_bo"
        Me.coldongia_bo.ReadOnly = True
        Me.coldongia_bo.Visible = False
        '
        'coldongia_ban
        '
        Me.coldongia_ban.DataPropertyName = "dongia_ban"
        Me.coldongia_ban.HeaderText = "dongia_ban"
        Me.coldongia_ban.Name = "coldongia_ban"
        Me.coldongia_ban.ReadOnly = True
        Me.coldongia_ban.Visible = False
        '
        'colchietkhau
        '
        Me.colchietkhau.DataPropertyName = "chietkhau"
        DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        Me.colchietkhau.DefaultCellStyle = DataGridViewCellStyle3
        Me.colchietkhau.HeaderText = " CK"
        Me.colchietkhau.Name = "colchietkhau"
        Me.colchietkhau.ReadOnly = True
        Me.colchietkhau.Visible = False
        Me.colchietkhau.Width = 40
        '
        'colma_nhomhanghoa
        '
        Me.colma_nhomhanghoa.DataPropertyName = "ma_nhomhanghoa"
        DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        Me.colma_nhomhanghoa.DefaultCellStyle = DataGridViewCellStyle4
        Me.colma_nhomhanghoa.HeaderText = "Nhóm HH"
        Me.colma_nhomhanghoa.Name = "colma_nhomhanghoa"
        Me.colma_nhomhanghoa.ReadOnly = True
        '
        'colma_duocchinh
        '
        Me.colma_duocchinh.DataPropertyName = "ma_duocchinh"
        DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        Me.colma_duocchinh.DefaultCellStyle = DataGridViewCellStyle5
        Me.colma_duocchinh.HeaderText = "Nhóm DC"
        Me.colma_duocchinh.Name = "colma_duocchinh"
        Me.colma_duocchinh.ReadOnly = True
        '
        'colhandung
        '
        Me.colhandung.DataPropertyName = "handung"
        DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        Me.colhandung.DefaultCellStyle = DataGridViewCellStyle6
        Me.colhandung.HeaderText = "HSD"
        Me.colhandung.Name = "colhandung"
        Me.colhandung.ReadOnly = True
        Me.colhandung.Width = 70
        '
        'colmin_
        '
        Me.colmin_.DataPropertyName = "min_"
        DataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle7.Format = "N0"
        Me.colmin_.DefaultCellStyle = DataGridViewCellStyle7
        Me.colmin_.HeaderText = "min_"
        Me.colmin_.Name = "colmin_"
        Me.colmin_.ReadOnly = True
        Me.colmin_.Width = 50
        '
        'colmax_
        '
        Me.colmax_.DataPropertyName = "max_"
        DataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight
        DataGridViewCellStyle8.Format = "N0"
        Me.colmax_.DefaultCellStyle = DataGridViewCellStyle8
        Me.colmax_.HeaderText = "max_"
        Me.colmax_.Name = "colmax_"
        Me.colmax_.ReadOnly = True
        Me.colmax_.Width = 50
        '
        'colsdk
        '
        Me.colsdk.DataPropertyName = "sdk"
        Me.colsdk.HeaderText = "sdk"
        Me.colsdk.Name = "colsdk"
        Me.colsdk.ReadOnly = True
        Me.colsdk.Visible = False
        '
        'coldkbaoquan
        '
        Me.coldkbaoquan.DataPropertyName = "dkbaoquan"
        Me.coldkbaoquan.HeaderText = "dkbaoquan"
        Me.coldkbaoquan.Name = "coldkbaoquan"
        Me.coldkbaoquan.ReadOnly = True
        Me.coldkbaoquan.Visible = False
        '
        'DataSetFormDonBindingSource
        '
        Me.DataSetFormDonBindingSource.DataSource = Me.DataSetForm_Don
        Me.DataSetFormDonBindingSource.Position = 0
        '
        'DataSetForm_Don
        '
        Me.DataSetForm_Don.DataSetName = "DataSetForm_Don"
        Me.DataSetForm_Don.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'TxtQC_Thung
        '
        Me.TxtQC_Thung.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtQC_Thung.Location = New System.Drawing.Point(566, 1)
        Me.TxtQC_Thung.MaxLength = 100
        Me.TxtQC_Thung.Name = "TxtQC_Thung"
        Me.TxtQC_Thung.Size = New System.Drawing.Size(17, 22)
        Me.TxtQC_Thung.TabIndex = 3
        Me.TxtQC_Thung.Text = "1"
        Me.TxtQC_Thung.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.TxtQC_Thung.Visible = False
        '
        'Label12
        '
        Me.Label12.Location = New System.Drawing.Point(626, 37)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(69, 19)
        Me.Label12.TabIndex = 78
        Me.Label12.Text = "Đơn vị tính"
        Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'TxtDV_Thung
        '
        Me.TxtDV_Thung.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtDV_Thung.Location = New System.Drawing.Point(586, 1)
        Me.TxtDV_Thung.MaxLength = 100
        Me.TxtDV_Thung.Name = "TxtDV_Thung"
        Me.TxtDV_Thung.Size = New System.Drawing.Size(19, 22)
        Me.TxtDV_Thung.TabIndex = 4
        Me.TxtDV_Thung.Text = "thùng"
        Me.TxtDV_Thung.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        Me.TxtDV_Thung.Visible = False
        '
        'TxtDV_Chan
        '
        Me.TxtDV_Chan.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtDV_Chan.ForeColor = System.Drawing.Color.Blue
        Me.TxtDV_Chan.Location = New System.Drawing.Point(694, 35)
        Me.TxtDV_Chan.MaxLength = 100
        Me.TxtDV_Chan.Name = "TxtDV_Chan"
        Me.TxtDV_Chan.Size = New System.Drawing.Size(104, 22)
        Me.TxtDV_Chan.TabIndex = 6
        Me.TxtDV_Chan.Text = "hộp"
        Me.TxtDV_Chan.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        '
        'TxtQC_Chan
        '
        Me.TxtQC_Chan.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtQC_Chan.ForeColor = System.Drawing.Color.Blue
        Me.TxtQC_Chan.Location = New System.Drawing.Point(611, 1)
        Me.TxtQC_Chan.MaxLength = 100
        Me.TxtQC_Chan.Name = "TxtQC_Chan"
        Me.TxtQC_Chan.Size = New System.Drawing.Size(15, 22)
        Me.TxtQC_Chan.TabIndex = 5
        Me.TxtQC_Chan.Text = "30"
        Me.TxtQC_Chan.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.TxtQC_Chan.Visible = False
        '
        'TxtDV_Le
        '
        Me.TxtDV_Le.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtDV_Le.Location = New System.Drawing.Point(660, 1)
        Me.TxtDV_Le.MaxLength = 100
        Me.TxtDV_Le.Name = "TxtDV_Le"
        Me.TxtDV_Le.Size = New System.Drawing.Size(22, 22)
        Me.TxtDV_Le.TabIndex = 8
        Me.TxtDV_Le.Text = "gói"
        Me.TxtDV_Le.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
        Me.TxtDV_Le.Visible = False
        '
        'TxtQC_Le
        '
        Me.TxtQC_Le.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtQC_Le.Location = New System.Drawing.Point(632, 1)
        Me.TxtQC_Le.MaxLength = 100
        Me.TxtQC_Le.Name = "TxtQC_Le"
        Me.TxtQC_Le.Size = New System.Drawing.Size(22, 22)
        Me.TxtQC_Le.TabIndex = 7
        Me.TxtQC_Le.Text = "20"
        Me.TxtQC_Le.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.TxtQC_Le.Visible = False
        '
        'CboNhomHH
        '
        Me.CboNhomHH.ArrowBoxColor = System.Drawing.SystemColors.Control
        Me.CboNhomHH.ArrowColor = System.Drawing.Color.Black
        Me.CboNhomHH.BindedControl = Nothing
        Me.CboNhomHH.BorderStyle = MTGCComboBox.TipiBordi.Fixed3D
        Me.CboNhomHH.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal
        Me.CboNhomHH.ColumnNum = 1
        Me.CboNhomHH.ColumnWidth = "121"
        Me.CboNhomHH.DisabledArrowBoxColor = System.Drawing.SystemColors.Control
        Me.CboNhomHH.DisabledArrowColor = System.Drawing.Color.LightGray
        Me.CboNhomHH.DisabledBackColor = System.Drawing.SystemColors.Control
        Me.CboNhomHH.DisabledBorderColor = System.Drawing.SystemColors.InactiveBorder
        Me.CboNhomHH.DisabledForeColor = System.Drawing.SystemColors.GrayText
        Me.CboNhomHH.DisplayMember = "Text"
        Me.CboNhomHH.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.CboNhomHH.DropDownBackColor = System.Drawing.Color.FromArgb(CType(CType(193, Byte), Integer), CType(CType(210, Byte), Integer), CType(CType(238, Byte), Integer))
        Me.CboNhomHH.DropDownForeColor = System.Drawing.Color.Black
        Me.CboNhomHH.DropDownStyle = MTGCComboBox.CustomDropDownStyle.DropDown
        Me.CboNhomHH.DropDownWidth = 141
        Me.CboNhomHH.GridLineColor = System.Drawing.Color.LightGray
        Me.CboNhomHH.GridLineHorizontal = False
        Me.CboNhomHH.GridLineVertical = False
        Me.CboNhomHH.LoadingType = MTGCComboBox.CaricamentoCombo.ComboBoxItem
        Me.CboNhomHH.Location = New System.Drawing.Point(104, 59)
        Me.CboNhomHH.ManagingFastMouseMoving = True
        Me.CboNhomHH.ManagingFastMouseMovingInterval = 30
        Me.CboNhomHH.Name = "CboNhomHH"
        Me.CboNhomHH.SelectedItem = Nothing
        Me.CboNhomHH.SelectedValue = Nothing
        Me.CboNhomHH.Size = New System.Drawing.Size(76, 21)
        Me.CboNhomHH.TabIndex = 9
        '
        'CboNhomDC
        '
        Me.CboNhomDC.ArrowBoxColor = System.Drawing.SystemColors.Control
        Me.CboNhomDC.ArrowColor = System.Drawing.Color.Black
        Me.CboNhomDC.BindedControl = Nothing
        Me.CboNhomDC.BorderStyle = MTGCComboBox.TipiBordi.Fixed3D
        Me.CboNhomDC.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal
        Me.CboNhomDC.ColumnNum = 1
        Me.CboNhomDC.ColumnWidth = "121"
        Me.CboNhomDC.DisabledArrowBoxColor = System.Drawing.SystemColors.Control
        Me.CboNhomDC.DisabledArrowColor = System.Drawing.Color.LightGray
        Me.CboNhomDC.DisabledBackColor = System.Drawing.SystemColors.Control
        Me.CboNhomDC.DisabledBorderColor = System.Drawing.SystemColors.InactiveBorder
        Me.CboNhomDC.DisabledForeColor = System.Drawing.SystemColors.GrayText
        Me.CboNhomDC.DisplayMember = "Text"
        Me.CboNhomDC.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.CboNhomDC.DropDownBackColor = System.Drawing.Color.FromArgb(CType(CType(193, Byte), Integer), CType(CType(210, Byte), Integer), CType(CType(238, Byte), Integer))
        Me.CboNhomDC.DropDownForeColor = System.Drawing.Color.Black
        Me.CboNhomDC.DropDownStyle = MTGCComboBox.CustomDropDownStyle.DropDown
        Me.CboNhomDC.DropDownWidth = 141
        Me.CboNhomDC.GridLineColor = System.Drawing.Color.LightGray
        Me.CboNhomDC.GridLineHorizontal = False
        Me.CboNhomDC.GridLineVertical = False
        Me.CboNhomDC.LoadingType = MTGCComboBox.CaricamentoCombo.ComboBoxItem
        Me.CboNhomDC.Location = New System.Drawing.Point(552, 59)
        Me.CboNhomDC.ManagingFastMouseMoving = True
        Me.CboNhomDC.ManagingFastMouseMovingInterval = 30
        Me.CboNhomDC.Name = "CboNhomDC"
        Me.CboNhomDC.SelectedItem = Nothing
        Me.CboNhomDC.SelectedValue = Nothing
        Me.CboNhomDC.Size = New System.Drawing.Size(81, 21)
        Me.CboNhomDC.TabIndex = 10
        '
        'TxtTenNhomDC
        '
        Me.TxtTenNhomDC.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtTenNhomDC.Location = New System.Drawing.Point(635, 59)
        Me.TxtTenNhomDC.MaxLength = 10
        Me.TxtTenNhomDC.Name = "TxtTenNhomDC"
        Me.TxtTenNhomDC.Size = New System.Drawing.Size(163, 22)
        Me.TxtTenNhomDC.TabIndex = 85
        '
        'Label13
        '
        Me.Label13.Location = New System.Drawing.Point(481, 61)
        Me.Label13.Name = "Label13"
        Me.Label13.Size = New System.Drawing.Size(63, 19)
        Me.Label13.TabIndex = 86
        Me.Label13.Text = "Nước SX"
        '
        'TxtChietKhau
        '
        Me.TxtChietKhau.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtChietKhau.Location = New System.Drawing.Point(642, 83)
        Me.TxtChietKhau.MaxLength = 10
        Me.TxtChietKhau.Name = "TxtChietKhau"
        Me.TxtChietKhau.Size = New System.Drawing.Size(155, 22)
        Me.TxtChietKhau.TabIndex = 13
        Me.TxtChietKhau.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label14
        '
        Me.Label14.Location = New System.Drawing.Point(540, 84)
        Me.Label14.Name = "Label14"
        Me.Label14.Size = New System.Drawing.Size(80, 19)
        Me.Label14.TabIndex = 89
        Me.Label14.Text = "Thuế VAT ( %)"
        '
        'TabMain
        '
        Me.TabMain.Appearance = System.Windows.Forms.TabAppearance.FlatButtons
        Me.TabMain.Controls.Add(Me.TabThongTin)
        Me.TabMain.Controls.Add(Me.TabTimKiem)
        Me.TabMain.Location = New System.Drawing.Point(2, 29)
        Me.TabMain.Name = "TabMain"
        Me.TabMain.SelectedIndex = 0
        Me.TabMain.Size = New System.Drawing.Size(904, 577)
        Me.TabMain.TabIndex = 90
        '
        'TabThongTin
        '
        Me.TabThongTin.BackColor = System.Drawing.Color.LightBlue
        Me.TabThongTin.Controls.Add(Me.LblRecords)
        Me.TabThongTin.Controls.Add(Me.Label17)
        Me.TabThongTin.Controls.Add(Me.txtDieuKien)
        Me.TabThongTin.Controls.Add(Me.Label15)
        Me.TabThongTin.Controls.Add(Me.txtSDK)
        Me.TabThongTin.Controls.Add(Me.DataGridView1)
        Me.TabThongTin.Controls.Add(Me.TxtChietKhau)
        Me.TabThongTin.Controls.Add(Me.btnSave)
        Me.TabThongTin.Controls.Add(Me.Label14)
        Me.TabThongTin.Controls.Add(Me.btnNew)
        Me.TabThongTin.Controls.Add(Me.CboNhomDC)
        Me.TabThongTin.Controls.Add(Me.btnDelete1)
        Me.TabThongTin.Controls.Add(Me.TxtTenNhomDC)
        Me.TabThongTin.Controls.Add(Me.BtnClose)
        Me.TabThongTin.Controls.Add(Me.Label13)
        Me.TabThongTin.Controls.Add(Me.Button1)
        Me.TabThongTin.Controls.Add(Me.CboNhomHH)
        Me.TabThongTin.Controls.Add(Me.Label2)
        Me.TabThongTin.Controls.Add(Me.Label3)
        Me.TabThongTin.Controls.Add(Me.Label4)
        Me.TabThongTin.Controls.Add(Me.TxtDV_Chan)
        Me.TabThongTin.Controls.Add(Me.txtMa_HH)
        Me.TabThongTin.Controls.Add(Me.txtTen_BD)
        Me.TabThongTin.Controls.Add(Me.txtTen_HD)
        Me.TabThongTin.Controls.Add(Me.Label5)
        Me.TabThongTin.Controls.Add(Me.Label12)
        Me.TabThongTin.Controls.Add(Me.TxtTenNhomHH)
        Me.TabThongTin.Controls.Add(Me.Label6)
        Me.TabThongTin.Controls.Add(Me.TxtHanDung)
        Me.TabThongTin.Controls.Add(Me.TxtGiaBan)
        Me.TabThongTin.Controls.Add(Me.Label10)
        Me.TabThongTin.Controls.Add(Me.Label7)
        Me.TabThongTin.Controls.Add(Me.TxtMax)
        Me.TabThongTin.Controls.Add(Me.TxtGiaSYT)
        Me.TabThongTin.Controls.Add(Me.Label9)
        Me.TabThongTin.Controls.Add(Me.Label8)
        Me.TabThongTin.Controls.Add(Me.TxtMin)
        Me.TabThongTin.Location = New System.Drawing.Point(4, 25)
        Me.TabThongTin.Name = "TabThongTin"
        Me.TabThongTin.Padding = New System.Windows.Forms.Padding(3)
        Me.TabThongTin.Size = New System.Drawing.Size(896, 548)
        Me.TabThongTin.TabIndex = 0
        Me.TabThongTin.Text = "Thông tin"
        '
        'LblRecords
        '
        Me.LblRecords.AutoSize = True
        Me.LblRecords.ForeColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer))
        Me.LblRecords.Location = New System.Drawing.Point(8, 179)
        Me.LblRecords.Name = "LblRecords"
        Me.LblRecords.Size = New System.Drawing.Size(45, 13)
        Me.LblRecords.TabIndex = 1116
        Me.LblRecords.Text = "Label18"
        Me.LblRecords.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label17
        '
        Me.Label17.Location = New System.Drawing.Point(361, 136)
        Me.Label17.Name = "Label17"
        Me.Label17.Size = New System.Drawing.Size(100, 17)
        Me.Label17.TabIndex = 93
        Me.Label17.Text = "Điều kiện bảo quản"
        '
        'txtDieuKien
        '
        Me.txtDieuKien.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtDieuKien.Location = New System.Drawing.Point(467, 132)
        Me.txtDieuKien.MaxLength = 10000
        Me.txtDieuKien.Name = "txtDieuKien"
        Me.txtDieuKien.Size = New System.Drawing.Size(331, 22)
        Me.txtDieuKien.TabIndex = 18
        '
        'Label15
        '
        Me.Label15.Location = New System.Drawing.Point(36, 133)
        Me.Label15.Name = "Label15"
        Me.Label15.Size = New System.Drawing.Size(62, 17)
        Me.Label15.TabIndex = 91
        Me.Label15.Text = "Số đăng ký"
        Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'txtSDK
        '
        Me.txtSDK.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtSDK.Location = New System.Drawing.Point(104, 132)
        Me.txtSDK.MaxLength = 10000
        Me.txtSDK.Name = "txtSDK"
        Me.txtSDK.Size = New System.Drawing.Size(257, 22)
        Me.txtSDK.TabIndex = 17
        '
        'TxtGiaSYT
        '
        Me.TxtGiaSYT.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.TxtGiaSYT.Location = New System.Drawing.Point(361, 83)
        Me.TxtGiaSYT.MaxLength = 10
        Me.TxtGiaSYT.Name = "TxtGiaSYT"
        Me.TxtGiaSYT.Size = New System.Drawing.Size(155, 22)
        Me.TxtGiaSYT.TabIndex = 12
        Me.TxtGiaSYT.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'TabTimKiem
        '
        Me.TabTimKiem.BackColor = System.Drawing.Color.LightBlue
        Me.TabTimKiem.Controls.Add(Me.LblRecordSearch)
        Me.TabTimKiem.Controls.Add(Me.Label16)
        Me.TabTimKiem.Controls.Add(Me.txtMaSearch)
        Me.TabTimKiem.Controls.Add(Me.btnTimKiem)
        Me.TabTimKiem.Controls.Add(Me.txtTenSearch)
        Me.TabTimKiem.Controls.Add(Me.Label11)
        Me.TabTimKiem.Controls.Add(Me.gridSearch)
        Me.TabTimKiem.Location = New System.Drawing.Point(4, 25)
        Me.TabTimKiem.Name = "TabTimKiem"
        Me.TabTimKiem.Padding = New System.Windows.Forms.Padding(3)
        Me.TabTimKiem.Size = New System.Drawing.Size(896, 548)
        Me.TabTimKiem.TabIndex = 1
        Me.TabTimKiem.Text = "Tìm kiếm"
        '
        'LblRecordSearch
        '
        Me.LblRecordSearch.AutoSize = True
        Me.LblRecordSearch.ForeColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer))
        Me.LblRecordSearch.Location = New System.Drawing.Point(8, 75)
        Me.LblRecordSearch.Name = "LblRecordSearch"
        Me.LblRecordSearch.Size = New System.Drawing.Size(50, 13)
        Me.LblRecordSearch.TabIndex = 1117
        Me.LblRecordSearch.Text = "0 mẫu tin"
        Me.LblRecordSearch.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label16
        '
        Me.Label16.AutoSize = True
        Me.Label16.Location = New System.Drawing.Point(190, 15)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(74, 13)
        Me.Label16.TabIndex = 75
        Me.Label16.Text = "Mã Hàng Hoá"
        Me.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'txtMaSearch
        '
        Me.txtMaSearch.Location = New System.Drawing.Point(265, 12)
        Me.txtMaSearch.Name = "txtMaSearch"
        Me.txtMaSearch.Size = New System.Drawing.Size(203, 20)
        Me.txtMaSearch.TabIndex = 74
        '
        'btnTimKiem
        '
        Me.btnTimKiem.Location = New System.Drawing.Point(266, 64)
        Me.btnTimKiem.Name = "btnTimKiem"
        Me.btnTimKiem.Size = New System.Drawing.Size(91, 23)
        Me.btnTimKiem.TabIndex = 73
        Me.btnTimKiem.Text = "Tìm kiếm..."
        Me.btnTimKiem.UseVisualStyleBackColor = True
        '
        'txtTenSearch
        '
        Me.txtTenSearch.Location = New System.Drawing.Point(266, 38)
        Me.txtTenSearch.Name = "txtTenSearch"
        Me.txtTenSearch.Size = New System.Drawing.Size(202, 20)
        Me.txtTenSearch.TabIndex = 72
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.Location = New System.Drawing.Point(186, 41)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(78, 13)
        Me.Label11.TabIndex = 71
        Me.Label11.Text = "Tên Hàng Hoá"
        Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'gridSearch
        '
        Me.gridSearch.AllowUserToAddRows = False
        Me.gridSearch.AllowUserToDeleteRows = False
        Me.gridSearch.AutoGenerateColumns = False
        DataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        DataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control
        DataGridViewCellStyle9.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        DataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText
        DataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight
        DataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText
        DataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
        Me.gridSearch.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle9
        Me.gridSearch.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.gridSearch.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ma_hanghoaS, Me.ten_bietduocS, Me.ten_hoaduocS, Me.donvi_banchanS, Me.donvi_thungS, Me.quicach_thungS, Me.quicach_banchanS, Me.donvi_banleS, Me.quicach_banleS, Me.dongia_boS, Me.dongia_banS, Me.chietkhauS, Me.ma_nhomhanghoaS, Me.ma_duocchinhS, Me.handungS, Me.min_S, Me.max_S, Me.sdkS, Me.dkbaoquanS})
        Me.gridSearch.DataMember = "tbl_hanghoaSearch"
        Me.gridSearch.DataSource = Me.DataSetSearchBindingSource
        Me.gridSearch.Location = New System.Drawing.Point(4, 93)
        Me.gridSearch.Name = "gridSearch"
        Me.gridSearch.RowHeadersWidth = 20
        Me.gridSearch.Size = New System.Drawing.Size(886, 452)
        Me.gridSearch.TabIndex = 69
        '
        'ma_hanghoaS
        '
        Me.ma_hanghoaS.DataPropertyName = "ma_hanghoa"
        Me.ma_hanghoaS.HeaderText = "Mã HH"
        Me.ma_hanghoaS.Name = "ma_hanghoaS"
        '
        'ten_bietduocS
        '
        Me.ten_bietduocS.DataPropertyName = "ten_bietduoc"
        Me.ten_bietduocS.HeaderText = "Tên HH"
        Me.ten_bietduocS.Name = "ten_bietduocS"
        Me.ten_bietduocS.Width = 250
        '
        'ten_hoaduocS
        '
        Me.ten_hoaduocS.DataPropertyName = "ten_hoaduoc"
        Me.ten_hoaduocS.HeaderText = "ten_hoaduoc"
        Me.ten_hoaduocS.Name = "ten_hoaduocS"
        Me.ten_hoaduocS.Visible = False
        '
        'donvi_banchanS
        '
        Me.donvi_banchanS.DataPropertyName = "donvi_banchan"
        DataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        Me.donvi_banchanS.DefaultCellStyle = DataGridViewCellStyle10
        Me.donvi_banchanS.HeaderText = "ĐVT"
        Me.donvi_banchanS.Name = "donvi_banchanS"
        '
        'donvi_thungS
        '
        Me.donvi_thungS.DataPropertyName = "donvi_thung"
        Me.donvi_thungS.HeaderText = "donvi_thung"
        Me.donvi_thungS.Name = "donvi_thungS"
        Me.donvi_thungS.Visible = False
        '
        'quicach_thungS
        '
        Me.quicach_thungS.DataPropertyName = "quicach_thung"
        Me.quicach_thungS.HeaderText = "quicach_thung"
        Me.quicach_thungS.Name = "quicach_thungS"
        Me.quicach_thungS.Visible = False
        '
        'quicach_banchanS
        '
        Me.quicach_banchanS.DataPropertyName = "quicach_banchan"
        Me.quicach_banchanS.HeaderText = "quicach_banchan"
        Me.quicach_banchanS.Name = "quicach_banchanS"
        Me.quicach_banchanS.Visible = False
        '
        'donvi_banleS
        '
        Me.donvi_banleS.DataPropertyName = "donvi_banle"
        Me.donvi_banleS.HeaderText = "donvi_banle"
        Me.donvi_banleS.Name = "donvi_banleS"
        Me.donvi_banleS.Visible = False
        '
        'quicach_banleS
        '
        Me.quicach_banleS.DataPropertyName = "quicach_banle"
        Me.quicach_banleS.HeaderText = "quicach_banle"
        Me.quicach_banleS.Name = "quicach_banleS"
        Me.quicach_banleS.Visible = False
        '
        'dongia_boS
        '
        Me.dongia_boS.DataPropertyName = "dongia_bo"
        Me.dongia_boS.HeaderText = "dongia_bo"
        Me.dongia_boS.Name = "dongia_boS"
        Me.dongia_boS.Visible = False
        '
        'dongia_banS
        '
        Me.dongia_banS.DataPropertyName = "dongia_ban"
        Me.dongia_banS.HeaderText = "dongia_ban"
        Me.dongia_banS.Name = "dongia_banS"
        Me.dongia_banS.Visible = False
        '
        'chietkhauS
        '
        Me.chietkhauS.DataPropertyName = "chietkhau"
        Me.chietkhauS.HeaderText = "chietkhau"
        Me.chietkhauS.Name = "chietkhauS"
        Me.chietkhauS.Visible = False
        '
        'ma_nhomhanghoaS
        '
        Me.ma_nhomhanghoaS.DataPropertyName = "ma_nhomhanghoa"
        DataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter
        Me.ma_nhomhanghoaS.DefaultCellStyle = DataGridViewCellStyle11
        Me.ma_nhomhanghoaS.HeaderText = "Nhóm"
        Me.ma_nhomhanghoaS.Name = "ma_nhomhanghoaS"
        Me.ma_nhomhanghoaS.Visible = False
        '
        'ma_duocchinhS
        '
        Me.ma_duocchinhS.DataPropertyName = "ma_duocchinh"
        Me.ma_duocchinhS.HeaderText = "ma_duocchinh"
        Me.ma_duocchinhS.Name = "ma_duocchinhS"
        Me.ma_duocchinhS.Visible = False
        '
        'handungS
        '
        Me.handungS.DataPropertyName = "handung"
        Me.handungS.HeaderText = "Hạn dùng"
        Me.handungS.Name = "handungS"
        '
        'min_S
        '
        Me.min_S.DataPropertyName = "min_"
        Me.min_S.HeaderText = "min_"
        Me.min_S.Name = "min_S"
        '
        'max_S
        '
        Me.max_S.DataPropertyName = "max_"
        Me.max_S.HeaderText = "max_"
        Me.max_S.Name = "max_S"
        '
        'sdkS
        '
        Me.sdkS.DataPropertyName = "sdk"
        Me.sdkS.HeaderText = "sdk"
        Me.sdkS.Name = "sdkS"
        Me.sdkS.Visible = False
        '
        'dkbaoquanS
        '
        Me.dkbaoquanS.DataPropertyName = "dkbaoquan"
        Me.dkbaoquanS.HeaderText = "dkbaoquan"
        Me.dkbaoquanS.Name = "dkbaoquanS"
        Me.dkbaoquanS.Visible = False
        '
        'DataSetSearchBindingSource
        '
        Me.DataSetSearchBindingSource.DataSource = Me.DataSetSearch
        Me.DataSetSearchBindingSource.Position = 0
        '
        'DataSetSearch
        '
        Me.DataSetSearch.DataSetName = "DataSetSearch"
        Me.DataSetSearch.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'frmHangHoa
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.LightBlue
        Me.ClientSize = New System.Drawing.Size(907, 603)
        Me.Controls.Add(Me.TabMain)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.TxtQC_Thung)
        Me.Controls.Add(Me.TxtDV_Thung)
        Me.Controls.Add(Me.TxtQC_Chan)
        Me.Controls.Add(Me.TxtQC_Le)
        Me.Controls.Add(Me.TxtDV_Le)
        Me.Name = "frmHangHoa"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Danh Muc Hang Hoa"
        Me.ContextMenuStrip1.ResumeLayout(False)
        CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetFormDonBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetForm_Don, System.ComponentModel.ISupportInitialize).EndInit()
        Me.TabMain.ResumeLayout(False)
        Me.TabThongTin.ResumeLayout(False)
        Me.TabThongTin.PerformLayout()
        Me.TabTimKiem.ResumeLayout(False)
        Me.TabTimKiem.PerformLayout()
        CType(Me.gridSearch, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetSearchBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.DataSetSearch, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Private dataNhomHH, dataNhomDC As DataTable
    Private da As MySqlDataAdapter
    Dim myDT As New DataTable
    Dim strError As String = ""
    Dim myform As Form
    Dim sqlQuery As String = ""
    Dim positionHangHoa As Integer = 0
    Public Sub SetclearData()
        txtMa_HH.Text = ""
        txtTen_BD.Text = ""
        txtTen_HD.Text = ""
        ' TxtTenNhomHH.Text = ""
        ' TxtTenNhomDC.Text = ""
        ' CboNhomHH.Text = ""
        ' CboNhomDC.Text = ""
        TxtQC_Thung.Text = "1"
        TxtDV_Thung.Text = "thùng"
        TxtQC_Chan.Text = "30"
        TxtDV_Chan.Text = "viên"
        TxtQC_Le.Text = "20"
        TxtDV_Le.Text = "gói"
        TxtGiaBan.Text = "0"
        TxtGiaSYT.Text = "0"
        TxtChietKhau.Text = "0"
        TxtHanDung.Text = "12"
        TxtMax.Text = "100"
        TxtMin.Text = "10"
        txtSDK.Text = ""
        txtDieuKien.Text = "Nơi thoáng mát.Dưới 30 độ C"
    End Sub
    Private Sub txtMaSearch_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtMaSearch.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtTenSearch.Focus()
        End If
    End Sub
    Private Sub txtTenSearch_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTenSearch.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnTimKiem.Focus()
        End If
    End Sub
    Private Sub txtMa_HH_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtMa_HH.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtTen_BD.Focus()
        End If
    End Sub

    Private Sub txtTen_BD_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtTen_BD.DoubleClick
        Dim myForm As New frmThayDoiMaSo
        myForm.setArg(9)
        myForm.setTable("tbl_hanghoa")
        myForm.setMa("ten_bietduoc")
        myForm.setMaChungTu(Me.txtTen_BD.Text.Trim)
        myForm.Show()
        myForm.setFrmHangHoa(Me)
        'Dim myForm As New frmThayDoiMaSo
        'myForm.setArg(1)
        'myForm.setMaChungTu(Me.txtMaPhieuNhap.Text.Trim)
        'myForm.Show()
        'myForm.setFrmPhieuNhapHangHoa(Me)
    End Sub
    Private Sub txtTen_BD_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTen_BD.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtTen_HD.Focus()
        End If
    End Sub

    Private Sub txtTen_HD_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTen_HD.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtDV_Chan.Focus()
        End If
    End Sub
    Private Sub TxtDV_Chan_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtDV_Chan.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.CboNhomHH.Focus()
        End If
    End Sub
    Private Sub CboNhomHH_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CboNhomHH.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.CboNhomDC.Focus()
        End If
    End Sub
    Private Sub CboNhomDC_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CboNhomDC.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtGiaBan.Focus()
        End If
    End Sub
    Private Sub TxtGiaBan_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtGiaBan.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtGiaSYT.Focus()
        End If
    End Sub
    Private Sub TxtGiaSYT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtGiaSYT.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtChietKhau.Focus()
        End If
    End Sub
    Private Sub TxtChietKhau_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtChietKhau.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtMin.Focus()
        End If
    End Sub
    Private Sub TxtMin_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtMin.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtMax.Focus()
        End If
    End Sub
    Private Sub TxtMax_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtMax.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.TxtHanDung.Focus()
        End If
    End Sub
    Private Sub TxtHanDung_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TxtHanDung.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtSDK.Focus()
        End If
    End Sub
    Private Sub txtSDK_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtSDK.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtDieuKien.Focus()
        End If
    End Sub
    Private Sub txtDieuKien_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtDieuKien.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnSave.Focus()
        End If
    End Sub
    Private Sub btnSave_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles btnSave.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.btnNew.Focus()
        End If
    End Sub
    Private Sub btnNew_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles btnNew.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.txtMa_HH.Focus()
        End If
    End Sub
    Private Sub frmNhomHangHoa_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        'tao moi
        If e.KeyCode = (e.Control And Keys.N) Then
            SetclearData()
            txtMa_HH.Focus()
        End If
        'Luu
        If e.KeyCode = (e.Control And Keys.S) Then
            luu()
        End If
        'Xoa
        If e.KeyCode = (e.Control And Keys.D) Then
            xoa()
        End If
        'Thoat
        If e.KeyCode = (e.Control And Keys.Q) Then
            Me.Close()
        End If
        If e.KeyCode = (e.Control And Keys.P) Then
            Dim report As FrmCrHangHoa = New FrmCrHangHoa
            report.setTrang(5)
            report.Show()
        End If
    End Sub

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        luu()
    End Sub
    Private Sub luu()
        ' Kiểm tra có nhập liệu chưa ?
        If Me.checkInput(txtMa_HH.Text, txtTen_BD.Text) Then
            Dim txtMaNH = Me.txtMa_HH.Text.Trim
            sqlQuery = "SELECT ma_hanghoa FROM tbl_hanghoa WHERE ma_hanghoa  = '" & txtMaNH & "'"
            Dim existedMamon As Integer = moduleDatabaseConn.CheckRecordExisted(sqlQuery)
            If existedMamon = 1 Then ' Update record
                moduleConstants.MessageWarning = " Mã hàng hóa đã tồn tại , bạn có muốn cập nhật không  ?"
                If MessageBox.Show(moduleConstants.MessageWarning, globalVariale.msgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = MsgBoxResult.Yes Then
                    If Me.CboNhomHH.Text.Trim = "ALL" Then
                        MessageBox.Show("Không cập nhật được khi chọn Mã Nhóm là ALL !!!")
                        Me.CboNhomHH.Focus()
                    Else
                        sqlQuery = "UPDATE tbl_hanghoa  "
                        sqlQuery += "SET "
                        sqlQuery += "ma_hanghoa  = '" & txtMaNH & "'"
                        sqlQuery += ", ten_bietduoc= '" & Me.txtTen_BD.Text.Trim & "'"
                        sqlQuery += ", ten_hoaduoc= '" & Me.txtTen_HD.Text.Trim & "'"
                        sqlQuery += ", donvi_thung= '" & Me.TxtDV_Thung.Text.Trim & "'"
                        sqlQuery += ", quicach_thung= '" & Me.TxtQC_Thung.Text.Trim & "'"
                        sqlQuery += ", donvi_banchan= '" & Me.TxtDV_Chan.Text.Trim & "'"
                        sqlQuery += ", quicach_banchan= '" & Me.TxtQC_Chan.Text.Trim & "'"
                        sqlQuery += ", donvi_banle= '" & Me.TxtDV_Le.Text.Trim & "'"
                        sqlQuery += ", quicach_banle= '" & Me.TxtQC_Le.Text.Trim & "'"
                        sqlQuery += ", dongia_bo= '" & Replace(Me.TxtGiaSYT.Text.Trim, ",", ".") & "'"
                        sqlQuery += ", dongia_ban= '" & Replace(Me.TxtGiaBan.Text.Trim, ",", ".") & "'"
                        sqlQuery += ", chietkhau= '" & Replace(Me.TxtChietKhau.Text.Trim, ",", ".") & "'"
                        sqlQuery += ", ma_nhomhanghoa= '" & Me.CboNhomHH.Text.Trim & "'"
                        sqlQuery += ", ma_duocchinh= '" & Me.CboNhomDC.Text.Trim & "'"
                        sqlQuery += ", handung= '" & Me.TxtHanDung.Text.Trim & "'"
                        sqlQuery += ", min_ = '" & Me.TxtMin.Text.Trim & "'"
                        sqlQuery += ", max_ = '" & Me.TxtMax.Text.Trim & "'"
                        sqlQuery += ", sdk = '" & Me.txtSDK.Text.Trim & "'"
                        sqlQuery += ", dkbaoquan = '" & Me.txtDieuKien.Text.Trim & "'"
                        sqlQuery += " WHERE ma_hanghoa = '" & txtMaNH & "'"
                        Dim updated As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                        If updated = 1 Then
                            MessageBox.Show("Cập nhật thông tin thành công !")
                            Me.loadDanhSachHangHoa()
                        Else
                            MessageBox.Show("Cập nhật thông tin không thành công: " & globalVariale.sqlMsgError)
                        End If
                    End If

                End If
            Else
                If existedMamon = 0 Then ' Insert record
                    If Me.CboNhomHH.Text.Trim = "ALL" Then
                        MessageBox.Show("Không cập nhật được khi chọn Mã Nhóm là ALL !!!")
                        Me.CboNhomHH.Focus()
                        Exit Sub
                    Else
                        sqlQuery = "SELECT ten_bietduoc FROM tbl_hanghoa WHERE ten_bietduoc  = '" & Me.txtTen_BD.Text.Trim & "'"
                        Dim ex As Integer = moduleDatabaseConn.CheckRecordExisted(sqlQuery)
                        If ex = 1 Then
                            moduleConstants.MessageWarning = "'Tên hàng hóa' đã tồn tại , bạn phải chọn tên khác  !!!"
                            MessageBox.Show(moduleConstants.MessageWarning, globalVariale.msgTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                            Me.txtTen_BD.Focus()
                            Exit Sub
                        End If
                    End If
                    sqlQuery = "INSERT INTO tbl_hanghoa "
                    sqlQuery += "(ma_hanghoa, ten_bietduoc,ten_hoaduoc,donvi_thung,quicach_thung,donvi_banchan,quicach_banchan,donvi_banle,quicach_banle,dongia_bo,dongia_ban,chietkhau,ma_nhomhanghoa,ma_duocchinh,handung,min_,max_,sdk,dkbaoquan)"
                    sqlQuery += "VALUES "
                    sqlQuery += "("
                    sqlQuery += "'" & txtMaNH.ToUpper & "', "
                    sqlQuery += " '" & Me.txtTen_BD.Text.Trim & "',"
                    sqlQuery += "  '" & Me.txtTen_HD.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtDV_Thung.Text.Trim & "',"
                    sqlQuery += "  '" & Me.TxtQC_Thung.Text.Trim & "',"
                    sqlQuery += "  '" & Me.TxtDV_Chan.Text.Trim & "',"
                    sqlQuery += "  '" & Me.TxtQC_Chan.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtDV_Le.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtQC_Le.Text.Trim & "',"
                    sqlQuery += " '" & Replace(Me.TxtGiaSYT.Text.Trim, ",", ".") & "',"
                    sqlQuery += " '" & Replace(Me.TxtGiaBan.Text.Trim, ",", ".") & "',"
                    sqlQuery += " '" & Me.TxtChietKhau.Text.Trim & "',"
                    sqlQuery += " '" & Me.CboNhomHH.Text.Trim & "',"
                    sqlQuery += " '" & Me.CboNhomDC.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtHanDung.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtMin.Text.Trim & "',"
                    sqlQuery += " '" & Me.TxtMax.Text.Trim & "',"
                    sqlQuery += " '" & Me.txtSDK.Text.Trim & "',"
                    sqlQuery += " '" & Me.txtDieuKien.Text.Trim & "'"
                    sqlQuery += ")"
                    Dim inserted As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                    If inserted = 1 Then
                        MessageBox.Show("Thêm thông tin thành công !")
                        Me.loadDanhSachHangHoa()
                        Me.SetclearData()
                    Else
                        MessageBox.Show("Thêm thông tin không thành công: " & globalVariale.sqlMsgError)
                    End If
                    'End If
                    '' SQLExeption: existedMaQuocGia = -1
                    '    MessageBox.Show("Lấy dữ liệu bị lỗi: " & globalVariale.sqlMsgError, "Lấy dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                End If
            End If
        End If
    End Sub

    Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
        SetclearData()
        txtMa_HH.Focus()
    End Sub
    Private Sub btnDelete1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete1.Click
        xoa()
    End Sub
    Private Sub xoa()
        Dim txtMaNH As String = Trim(Me.txtMa_HH.Text)
        If txtMaNH = "" Then
            MessageBox.Show("Bạn chưa chọn Mã để xóa !")
        Else
            Dim txtTenNH As String = Trim(Me.txtTen_BD.Text)
            moduleConstants.MessageWarning = "Bạn có muốn xóa " & txtMaNH & "(" & txtTenNH & ") ?"
            If MessageBox.Show(moduleConstants.MessageWarning, globalVariale.msgTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = MsgBoxResult.Yes Then
                Dim sqlQuery As String = "DELETE FROM tbl_hanghoa WHERE ma_hanghoa = '" & txtMaNH & "'"
                Dim deleting As Integer = moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                '15 03 2011
                'xóa ở các bảng khác
                sqlQuery = "DELETE FROM tbl_nhap_chitiet_hanghoa WHERE ma_hanghoa = '" & txtMaNH & "'"
                moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                sqlQuery = "DELETE FROM tbl_xuat_chitiet_hanghoa WHERE ma_hanghoa = '" & txtMaNH & "'"
                moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                'nhập xuất tồn - tổng hợp
                sqlQuery = "DELETE FROM tbl_dot_nhapxuattonghop WHERE ma_hanghoa ='" & txtMaNH & "'"
                moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                'nhập xuất tồn - theo lô
                sqlQuery = "DELETE FROM tbl_dot_nhapxuattonghop_lo WHERE ma_hanghoa ='" & txtMaNH & "'"
                moduleDatabaseConn.ExecuteNonQuery(sqlQuery)
                'end
                If deleting = 1 Then
                    MessageBox.Show("Xóa thông tin thành công !")
                    Me.loadDanhSachHangHoa()
                    SetclearData()
                Else
                    MessageBox.Show("Xóa thông tin không thành công: " & globalVariale.sqlMsgError)
                End If
            End If
        End If
    End Sub
    Private Sub frmHangHoa_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        moduleUtils.setDinhDangVietNam()
        Me.KeyPreview = True
        Me.loadDanhSachNhomHH()
        Me.loadDanhSachNhomDC()
        Me.loadDanhSachHangHoa()
        'roles
        edit = moduleConstants.edit
        If edit = 0 Then
            Me.btnNew.Enabled = False
            Me.btnSave.Enabled = False
            Me.btnDelete1.Enabled = False
            Me.Button1.Enabled = False
            Me.DataGridView1.ReadOnly = True

        End If

    End Sub
    Private Sub BtnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClose.Click
        Me.Close()
    End Sub

    Function checkInput(ByVal ma As String, ByVal ten As String) As Boolean
        Dim result As Boolean = True
        If ma = "" Then
            MessageBox.Show("Bạn chưa nhập Mã  !")
            result = False
        End If
        If ten = "" Then
            MessageBox.Show("Bạn chưa nhập tên  !")
            result = False
        End If
        
        Return result
    End Function

    Private Sub loadDanhSachHangHoa()
       
        sqlQuery = "SELECT * FROM tbl_hanghoa "
        DataGridView1.DataSource = moduleDatabaseConn.GetDataTable(sqlQuery)
        Me.LblRecords.Text = Me.DataGridView1.Rows.Count & " mẫu tin"
    End Sub
    Private Sub loadDanhSachNhomHH()
        Try
            Dim sqlQuery As String = ""
            sqlQuery = "SELECT ma_nhom_hanghoa, ten_nhom_hanghoa FROM tbl_nhom_hanghoa ORDER BY ma_nhom_hanghoa"
            dataNhomHH = moduleDatabaseConn.GetDataTable(sqlQuery)
            CboNhomHH.Items.Clear()
            CboNhomHH.LoadingType = MTGCComboBox.CaricamentoCombo.DataTable
            CboNhomHH.ColumnNum = 2
            CboNhomHH.ColumnWidth = "100;250"
            CboNhomHH.HighlightBorderColor = Color.Black
            CboNhomHH.GridLineHorizontal = True
            CboNhomHH.GridLineVertical = True
            CboNhomHH.ItemHeight = 17
            CboNhomHH.DropDownHeight = 300
            CboNhomHH.SourceDataTable = dataNhomHH
            CboNhomHH.SelectedIndex = 0
        Catch ex As Exception
            MessageBox.Show("Bạn chưa nhập thông tin nhóm hàng hóa  !")
        End Try

    End Sub
    Private Sub CboNhomHH_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CboNhomHH.SelectedIndexChanged
        Try
            Me.TxtTenNhomHH.Text = Me.CboNhomHH.SelectedItem.Col2
            Me.loadDanhSachHangHoa()
        Catch ex As Exception
            Me.TxtTenNhomHH.Text = ""
        End Try


    End Sub
    Private Sub loadDanhSachNhomDC()
        Try
            Dim sqlQuery As String = ""
            sqlQuery = "SELECT ma_nhom_duocchinh, ten_nhom_duocchinh FROM tbl_nhom_duocchinh ORDER BY ma_nhom_duocchinh"
            dataNhomDC = moduleDatabaseConn.GetDataTable(sqlQuery)
            CboNhomDC.Items.Clear()
            CboNhomDC.LoadingType = MTGCComboBox.CaricamentoCombo.DataTable
            CboNhomDC.ColumnNum = 2
            CboNhomDC.ColumnWidth = "100;250"
            CboNhomDC.HighlightBorderColor = Color.Black
            CboNhomDC.GridLineHorizontal = True
            CboNhomDC.GridLineVertical = True
            CboNhomDC.ItemHeight = 17
            CboNhomDC.DropDownHeight = 300
            CboNhomDC.SourceDataTable = dataNhomDC
            CboNhomDC.SelectedIndex = 0
        Catch ex As Exception
            MessageBox.Show("Bạn chưa nhập thông tin nhóm Dược chính  !")
        End Try
    End Sub
    Private Sub CboNhomDC_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CboNhomDC.SelectedIndexChanged
        Try
            Me.TxtTenNhomDC.Text = Me.CboNhomDC.SelectedItem.Col2
        Catch ex As Exception
            Me.TxtTenNhomDC.Text = ""
        End Try
    End Sub

    Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        If e.RowIndex >= 0 Then
            Dim iRow As Integer = Me.DataGridView1.CurrentRow.Index
            Me.txtMa_HH.Text = Me.DataGridView1.Item(Me.colma_hanghoa.Index, iRow).Value
            Me.txtTen_BD.Text = Me.DataGridView1.Item(Me.colten_bietduoc.Index, iRow).Value
            Me.txtTen_HD.Text = Me.DataGridView1.Item(Me.colten_hoaduoc.Index, iRow).Value
            Me.TxtDV_Thung.Text = Me.DataGridView1.Item(Me.coldonvi_thung.Index, iRow).Value
            Me.TxtQC_Thung.Text = Me.DataGridView1.Item(Me.colquicach_thung.Index, iRow).Value
            Me.TxtDV_Chan.Text = Me.DataGridView1.Item(Me.coldonvi_banchan.Index, iRow).Value
            Me.TxtQC_Chan.Text = Me.DataGridView1.Item(Me.colquicach_banchan.Index, iRow).Value
            Me.TxtDV_Le.Text = Me.DataGridView1.Item(Me.coldonvi_banle.Index, iRow).Value
            Me.TxtQC_Le.Text = Me.DataGridView1.Item(Me.colquicach_banle.Index, iRow).Value
            Me.TxtGiaSYT.Text = Me.DataGridView1.Item(Me.coldongia_bo.Index, iRow).Value
            Me.TxtGiaBan.Text = Me.DataGridView1.Item(Me.coldongia_ban.Index, iRow).Value
            Me.TxtChietKhau.Text = Me.DataGridView1.Item(Me.colchietkhau.Index, iRow).Value
            Me.TxtHanDung.Text = Me.DataGridView1.Item(Me.colhandung.Index, iRow).Value
            Me.TxtMin.Text = Me.DataGridView1.Item(Me.colmin_.Index, iRow).Value
            Me.TxtMax.Text = Me.DataGridView1.Item(Me.colmax_.Index, iRow).Value
            Me.txtSDK.Text = Me.DataGridView1.Item(Me.colsdk.Index, iRow).Value
            Me.txtDieuKien.Text = Me.DataGridView1.Item(Me.coldkbaoquan.Index, iRow).Value
            'combobox
            moduleUtils.setIndexComBo(Me.DataGridView1.Item(colma_nhomhanghoa.Index, iRow).Value, Me.CboNhomHH, dataNhomHH)
            moduleUtils.setIndexComBo(Me.DataGridView1.Item(colma_duocchinh.Index, iRow).Value, Me.CboNhomDC, dataNhomDC)
            '  Me.CboNhomHH.Text = Me.DataGridView1.Item(Me.colma_nhomhanghoa.Index, iRow).Value
            '  Me.CboNhomDC.Text = Me.DataGridView1.Item(Me.colma_duocchinh.Index, iRow).Value
        End If
    End Sub
    Private Sub gridSearch_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridSearch.DoubleClick
        Me.TabMain.SelectedTab = Me.TabThongTin
        Dim iRow As Integer = Me.gridSearch.CurrentRow.Index
        Me.txtMa_HH.Text = Me.gridSearch.Item(Me.ma_hanghoaS.Index, iRow).Value
        Me.txtTen_BD.Text = Me.gridSearch.Item(Me.ten_bietduocS.Index, iRow).Value
        Me.txtTen_HD.Text = Me.gridSearch.Item(Me.ten_hoaduocS.Index, iRow).Value
        Me.TxtDV_Thung.Text = Me.gridSearch.Item(Me.donvi_thungS.Index, iRow).Value
        Me.TxtQC_Thung.Text = Me.gridSearch.Item(Me.quicach_thungS.Index, iRow).Value
        Me.TxtDV_Chan.Text = Me.gridSearch.Item(Me.donvi_banchanS.Index, iRow).Value
        Me.TxtQC_Chan.Text = Me.gridSearch.Item(Me.quicach_banchanS.Index, iRow).Value
        Me.TxtDV_Le.Text = Me.gridSearch.Item(Me.donvi_banleS.Index, iRow).Value
        Me.TxtQC_Le.Text = Me.gridSearch.Item(Me.quicach_banleS.Index, iRow).Value
        Me.TxtGiaSYT.Text = Me.gridSearch.Item(Me.dongia_boS.Index, iRow).Value
        Me.TxtGiaBan.Text = Me.gridSearch.Item(Me.dongia_banS.Index, iRow).Value
        Me.TxtChietKhau.Text = Me.gridSearch.Item(Me.chietkhauS.Index, iRow).Value
        Me.TxtHanDung.Text = Me.gridSearch.Item(Me.handungS.Index, iRow).Value
        Me.TxtMin.Text = Me.gridSearch.Item(Me.min_S.Index, iRow).Value
        Me.TxtMax.Text = Me.gridSearch.Item(Me.max_S.Index, iRow).Value
        Me.txtSDK.Text = Me.gridSearch.Item(Me.sdkS.Index, iRow).Value
        Me.txtDieuKien.Text = Me.gridSearch.Item(Me.dkbaoquanS.Index, iRow).Value
        'combobox
        Me.CboNhomHH.Text = Me.gridSearch.Item(Me.ma_nhomhanghoaS.Index, iRow).Value
        Me.CboNhomDC.Text = Me.gridSearch.Item(Me.ma_duocchinhS.Index, iRow).Value
        Me.LblRecords.Text = Me.DataGridView1.Rows.Count & " mẫu tin"

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        inphieu(1)
    End Sub
    Private Sub inphieu(ByVal flag As Integer)
        Dim report As FrmCrHangHoa = New FrmCrHangHoa
        report.setTrang(5)
        report.setInBaocao(flag)
        report.Show()
    End Sub
    Private Sub btnTimKiem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimKiem.Click
        If Me.txtMaSearch.Text.Trim = "" And Me.txtTenSearch.Text.Trim = "" Then
            MessageBox.Show("Bạn phải nhập thông tin tìm kiếm !!!")
            Me.txtMaSearch.Focus()
        Else
            sqlQuery = "SELECT *  FROM tbl_hanghoa "
            sqlQuery += " where ma_hanghoa like '%" & Me.txtMaSearch.Text & "%'"
            sqlQuery += " and  ten_bietduoc like '%" & Me.txtTenSearch.Text & "%'"
            Me.gridSearch.DataSource = moduleDatabaseConn.GetDataTable(sqlQuery)
            Me.LblRecordSearch.Text = Me.gridSearch.Rows.Count & " mẫu tin"
        End If
    End Sub
    Private Sub loadToFormThongTin(ByVal txtMaHangHoa As String)
        sqlQuery = "SELECT * FROM tbl_hanghoa "
        sqlQuery += " where ma_hanghoa = '" & txtMaHangHoa & "'"
        Dim tmp As DataTable = moduleDatabaseConn.GetDataTable(sqlQuery)
        Try
            Me.txtMa_HH.Text = txtMaHangHoa
            Me.txtTen_BD.Text = tmp.Rows.Item(0).Item(1)
            Me.txtTen_HD.Text = tmp.Rows.Item(0).Item(2)
            Me.TxtDV_Thung.Text = tmp.Rows.Item(0).Item(3)
            Me.TxtQC_Thung.Text = tmp.Rows.Item(0).Item(4)
            Me.TxtDV_Chan.Text = tmp.Rows.Item(0).Item(5)
            Me.TxtQC_Chan.Text = tmp.Rows.Item(0).Item(6)
            Me.TxtDV_Le.Text = tmp.Rows.Item(0).Item(7)
            Me.TxtQC_Le.Text = tmp.Rows.Item(0).Item(8)
            Me.TxtGiaSYT.Text = tmp.Rows.Item(0).Item(9)
            Me.TxtGiaBan.Text = tmp.Rows.Item(0).Item(10)
            Me.TxtChietKhau.Text = tmp.Rows.Item(0).Item(11)
            Me.CboNhomHH.SelectedIndex = getIndex(dataNhomHH, Me.CboNhomHH, tmp.Rows.Item(0).Item(12))
            Me.CboNhomDC.Text = tmp.Rows.Item(0).Item(13)
            Me.TxtHanDung.Text = tmp.Rows.Item(0).Item(14)
            Me.TxtMin.Text = tmp.Rows.Item(0).Item(15)
            Me.TxtMax.Text = tmp.Rows.Item(0).Item(16)
        Catch ex As Exception
        End Try
    End Sub
    Function getIndex(ByVal data As DataTable, ByVal cbo As ComboBox, ByVal ma As String)
        Dim index As Integer = 0
        For i As Integer = 0 To data.Rows.Count
            If ma = data.Rows.Item(i).Item(0) Then
                positionHangHoa = i
                index = i
                cbo.SelectedIndex = index
            End If
        Next
        Return index
    End Function
    Public Sub reloadForm()
        Me.loadDanhSachNhomHH()
        Me.loadDanhSachNhomDC()
        Me.loadDanhSachHangHoa()
    End Sub
    Private Sub txtMa_HH_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMa_HH.DoubleClick
        Dim myForm As New frmThayDoiMaSo
        myForm.setArg(3)
        myForm.setTable("tbl_hanghoa")
        myForm.setMa("ma_hanghoa")
        myForm.setMaChungTu(Me.txtMa_HH.Text.Trim)
        myForm.Show()
        myForm.setFrmHangHoa(Me)
        'Dim myForm As New frmThayDoiMaSo
        'myForm.setArg(1)
        'myForm.setMaChungTu(Me.txtMaPhieuNhap.Text.Trim)
        'myForm.Show()
        'myForm.setFrmPhieuNhapHangHoa(Me)
    End Sub

    Private Sub InDSKháchHàngToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InDSKháchHàngToolStripMenuItem.Click
        'In DS Hang hoa 
        inphieu(0)
    End Sub

    Private Sub InDSKháchHàngGDPToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InDSKháchHàngGDPToolStripMenuItem.Click
        'In DS Hang hoa GDP
        inphieu(1)
    End Sub
End Class


